package com.chenyuxin.ilp.service.file.producer;

import com.chenyuxin.ilp.model.vo.file.FileConvertTask;
import com.chenyuxin.ilp.service.file.ConvertFileService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ConvertFileProducer {
    private final String EXCHANGE = "convert.to.pdf";

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendWordToPDFTask(FileConvertTask task) {
        rabbitTemplate.convertAndSend(EXCHANGE, "word.to.pdf", task);
    }
    public void sendPPTToPDFTask(FileConvertTask task){
        rabbitTemplate.convertAndSend(EXCHANGE,"ppt.to.pdf",task);
    }
    public void sendExcelToPDFTask(FileConvertTask task){
        rabbitTemplate.convertAndSend(EXCHANGE,"excel.to.pdf",task);
    }


}
